<!--
 * @Description  :
 * @Author       : YiDing Xue
 * @Date         : 2023-02-22
 * @LastEditors  : YiDing Xue
 * @LastEditTime : 2023-03-10
-->
<template>
  <AppProvider>
    <router-view v-slot="{ Component }">
      <component :is="Component" />
    </router-view>
    <MiniPlayer />
  </AppProvider>
</template>
<script setup>
import { setToken } from '@/utils'
import { useUserStore } from '@/store/modules/user/index.js'
import { getURLParameters } from '@/utils/common/common.js'
import { setUid } from '@/utils/storage/common.js'
import { onMounted } from 'vue'
onMounted(() => {
  const paramsObj = getURLParameters()
  if (paramsObj.token) {
    setToken(paramsObj.token)
  }
  if (paramsObj.uId || paramsObj.uid) {
    useUserStore().setUid(paramsObj.uId || paramsObj.uid)
    setUid(paramsObj.uId || paramsObj.uid)
  }
  useUserStore().setUserInfo(paramsObj)
})
</script>
<style lang="" scoped>
</style>
